<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch" data-options="{searchDatagrid:$.CurrentNavtab.find('#datagrid-supplier-list')}">
        <fieldset>
            <legend style="font-weight:normal;">页头搜索：</legend>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>供应商名称：</span>
                <input type="text" name="supplier_name" class="form-control" size="15">

                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
                    <button type="reset" class="btn-orange" data-icon="times">重置</button>
                </div>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="datagrid-supplier-list" data-toggle="datagrid" data-options="{
        height: '100%',
        gridTitle : '供应商列表',
        editMode: {dialog:{id:'supplier-custom-save', url:'/admin/supplier/custom-save', type:'get', title:'供应商添加', width:700, height:500}},
        local: 'remote',
        showToolbar: true,
        toolbarItem:'add,export',
        dataUrl: '/admin/supplier/list',
        editUrl: '/admin/supplier/save',
        delUrl: '/admin/supplier/del',
        delPK: 'id',
        linenumberAll: true,
        sortAll: false,
        contextMenuH: true,
        contextMenuB: true,
        showCheckboxcol: true,
        inlineEditMult: true,
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        showEditbtnscol: '操作',
        customEditbtns: {width:200,position:'replace'},
        fullGrid: true,
        {{--fieldSortable: false,--}}
         sortAll:true,
        filterThead: false,
        columnMenu: false,
        exportOption:{type:'file', options:{url:'admin/supplier/export', type:'get', data: {_token : '{{ csrf_token() }}'}}}
        }">
        <thead>
        <tr>
            <th data-options="{name:'supplier_name',align:'center',width:100}">供应商名称</th>
            <th data-options="{name:'avatars_url', render:'create_img_tag',align:'center',width:100}">头像</th>
            <th data-options="{name:'supplier_level_title',align:'center',width:100}">分类</th>
            <th data-options="{name:'supplier_tel',align:'center',width:100}">供应商电话</th>
            <th data-options="{name:'address',align:'center',width:100}">地区</th>
            <th data-options="{name:'supplier_address',align:'center',width:100}">详细地址</th>
            <th data-options="{name:'contact_person',align:'center',width:100}">供应商代表</th>
            <th data-options="{name:'contact_phone',align:'center',width:100}">供应商代表电话</th>
            <th data-options="{name:'contact_address',align:'center',width:100}">供应商代表地址</th>
            <th data-options="{name:'sort_id',align:'center',width:100}">排序</th>
        </tr>
        </thead>
    </table>
</div>
<script>
    function create_img_tag(value){
        return '<img src="'+value+'" width="100" height="100">';
    }
</script>
